package com.haohope.framework.wb.lock;

import java.util.concurrent.TimeUnit;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;

public class RedissionUserListLock extends UserListLock{
	private RLock lock = null;
	public RedissionUserListLock(RedissonClient redissonClient) {
		lock = redissonClient.getLock("haohope:lock:userlist");
	}
	@Override
	public void _lock() {
		lock.lock();
	}
	@Override
	public void _lockInterruptibly() throws InterruptedException {
		lock.lockInterruptibly();
	}
	@Override
	public boolean _tryLock() {
		return lock.tryLock();
	}
	@Override
	public boolean _tryLock(long time, TimeUnit unit) throws InterruptedException {
		return lock.tryLock(time, unit);
	}
	@Override
	public void _unlock() {
		lock.unlock();
	}
}
